#!/bin/bash

BUNDLE="`echo "$0" | sed -e 's/\/Contents\/MacOS\/.*//'`"
BUNDLE_BIN_DIR="$BUNDLE/Contents/MacOS"
BUNDLE_RES_DIR="$BUNDLE/Contents/Resources"

##echo "BUNDLE_BIN_DIR: $BUNDLE_BIN_DIR"
##echo "BUNDLE_RES_DIR: $BUNDLE_RES_DIR"

export GDAL_DATA=$BUNDLE_RES_DIR/gdal
export OTB_APPLICATION_PATH=$BUNDLE_BIN_DIR/otb/applications

cd $HOME

exec "$BUNDLE_BIN_DIR/@EXECUTABLE_NAME@"
